Method and apparatus for transporting behavior in an event-based distributed system

ABSTRACT

In a distributed computing system, a first process may register interest in an event occurring in another address space or physical machine in such a way as to allow the subsequent notification of the event&#39;s occurrence to contain an object that includes methods that are to be run on receipt of the notification. When the notification is received, either by the first process or by some other entity designated by the first process to be the final point of notification, the methods may be executed as specified by the first process.

FIELD OF THE INVENTION

[0001] This invention relates generally to a distributed computer systemand more specifically to event handling procedures in a distributedcomputer system.

BACKGROUND OF THE INVENTION

[0002] Distributed computer systems are systems in which the programmingand data that the computer operates on are spread out over more than onecomputer, usually over a network with many computers. One conventionalmethod for organizing a distributed system uses the client-server model,in which one part of the distributed system (the client) asks for someservice from another part of the distributed system (the server). Theserver responds and then handles the client's request appropriately.

[0003] Under the client-server model, when the client encounters aprocedure located at the server, the procedure may be implemented usingsome form of a Remote Procedure Call (RPC): the client informs theserver that it would like the procedure executed using certainparameters, the server executes the procedure, and the server returnsthe results of the execution to the client.

[0004] An alternative method for organizing distributed systems uses theevent/notification model. In this model, a “listener” process, which isinterested in the occurrence of an event within another entity withinthe system, registers its interest with a second process, a “notifier”process, designed to monitor such events. When the event occurs, thenotifier notifies the listener or notifies another process (i.e., athird party process) designated by the listener when registering withthe notifier. After receiving the event notification, that notifiedentity (i.e., the listener or the third party listener, as the case maybe) may execute a function designated in the notification and present inthe address space of the notified process. In the event-notificationmodel, there is no single point of control as in the client-servermodel; instead, control is determined by notifications sent in responseto the occurrence of designated events.

[0005] In a non-distributed system, the association of an event with thefunction to be run in response to the notification, called a callbackfunction, is straightforward, since the event, the listener, and thecallback function are all in a single address space. Life is not sosimple in a distributed system. The listener may be in one address spaceor physical machine, the event may be generated in a second addressspace or physical machine (e.g., the address space of the notifier or anaddress space that the notifier monitors), and the notification may besent to a third address space or physical machine (e.g., the addressspace of the third party process). This makes it difficult for thelistener to insure that the third party process will be able to respondto the event in an appropriate manner, as the two may be separated and,possibly, might not even know of the other's existence. For example, thelistener, to ensure that the correct function is executed by the thirdparty, must keep track of whether the function is available in the thirdparty's address space. This can be particularly burdensome when anadministrator desires to update functions in the third party's addressspace, as all the potential distributed users of the new function mustbe updated on the status of the new function.

[0006] Thus, there is a need in the art to more effectively handledistributed programs collaborating using the event-notification model.This need is particularly poignant in systems in which the requestingentity is not able to easily verify the status of a function present atthe executing entity.

SUMMARY OF THE INVENTION

[0007] Objects and advantages of the invention will be set forth in partin the description which follows, and in part will be obvious from thedescription, or may be learned by practice of the invention. The objectsand advantages of the invention will be realized and attained by meansof the elements and combinations particularly pointed out in theappended claims.

[0008] To achieve the objects and in accordance with the purpose of theinvention, as embodied and broadly described herein, a first aspectconsistent with the present invention includes a method for controllingprogram execution in a distributed computer system comprising the stepsof: (1) registering interest in an occurrence of an event in thedistributed computer system, the registration of interest includinginformation identifying the occurrence of the event, an identifier of asoftware entity in the distributed system, and a first object includinga process and parameter data corresponding to the process; (2)monitoring at least a portion of the distributed computer system for theoccurrence of the registered event; (3) notifying the software entityidentified in the registration of interest when the event occurs, thenotification including a copy of the first object and an identificationof the event that occurred; and (4) executing methods contained withinthe first object in response to the notifying step.

[0009] To achieve the objects and in accordance with the purpose of theinvention, as embodied and broadly described herein, a second aspectconsistent with the present invention includes a protocol forcontrolling the execution of processes in a distributed computer system,the protocol comprises a number of steps, including: (1) receiving aregistration of interest in an event that is expected to occur in thedistributed computer system, the registration including an identifier ofa software entity in the distributed system and a first object, thefirst object including computer instructions for performing a processand parameter data corresponding to the process; (2) monitoring thedistributed system for the occurrence of the registered event; and (3)notifying the software entity identified in the registration of interestwhen the event occurs, the notification including a copy of the firstobject and an identification of the event that occurred.

[0010] A third aspect of the present invention is a computer systemcomprising memories having first, second, and third virtual machines,respectively. The second virtual machine executes a process thatreceives, from the first virtual machine, a registration of interest inan event and transmits a message in response to the occurrence of theevent, the registration of interest and the message including an object.The third virtual machine receives the message and executes methodscontained within the object.

[0011] Additional aspects of the present invention, related to the firstaspect, are directed to a computer readable medium and a computer datasignal embodied in a carrier wave.

BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings, which are incorporated in andconstitute a part of this specification, illustrate several embodimentsconsistent with this invention and, together with the description, helpexplain the principles of the invention. In the drawings,

[0013]FIG. 1 is a diagram of an exemplary distributed system;

[0014]FIG. 2 is a diagram of an exemplary computer within the exemplarydistributed system;

[0015]FIG. 3A is a flow chart illustrating methods consistent with thepresent invention for notifying and transporting behavior in an eventbased distributed system;

[0016]FIG. 3B is a table showing exemplary event notification requestsstored in a computer memory; and

[0017]FIG. 4 is a block diagram illustrating a distributed computingsystem containing three exemplary computer platforms connected to oneanother via a network.

DETAILED DESCRIPTION

[0018] This disclosure describes a protocol allowing a listener processto register interest in an event occurring in another address space orphysical machine in such a way as to allow the subsequent notificationof the event's occurrence to contain an object that may include methodsthat are to be run on receipt of the notification. When the notificationis received, either by the listener or by a third party, the methods maybe executed as specified by the listener.

[0019] Referring to the accompanying drawings, a detailed description ofan embodiment consistent with the present invention will now bedescribed.

[0020] Methods and systems consistent with the present invention operatein a distributed system (“the exemplary distributed system”) withvarious components, including both hardware and software. The exemplarydistributed system (1) allows users of the system to share services andresources over a network of many devices; (2) provides programmers withtools and programming patterns that allow development of robust, secureddistributed systems; and (3) simplifies the task of administering thedistributed system. To accomplish these goals, the exemplary distributedsystem utilizes the Java™ programming environment to allow both code anddata to be moved from device to device in a seamless manner.Accordingly, the exemplary distributed system is layered on top of theJava programming environment and exploits the characteristics of thisenvironment, including the security offered by it and the strong typingprovided by it. The Java programming environment is more clearlydescribed in Jaworski, Java 1.1 Developer's Guide, Sams.net (1997),which is incorporated herein by reference.

[0021] In the exemplary distributed system, different computers anddevices are federated into what appears to the user to be a singlesystem. By appearing as a single system, the exemplary distributedsystem provides the simplicity of access and the power of sharing thatcan be provided by a single system without giving up the flexibility andpersonalized response of a personal computer or workstation. Theexemplary distributed system may contain thousands of devices operatedby users who are geographically disperse, but who agree on basic notionsof trust, administration, and policy.

[0022] Within the exemplary distributed system are various logicalgroupings of services provided by one or more devices, and each suchlogical grouping is known as a Djinn. A “service” refers to a resource,data, or functionality that can be accessed by a user, program, device,or another service and that can be computational, storage related,communication related, or related to providing access to another user.Examples of services provided as part of a Djinn include devices, suchas printers, displays, and disks; software, such as applications orutilities; information, such as databases and files; and users of thesystem.

[0023] Both users and devices may join a Djinn. When joining a Djinn,the user or device adds zero or more services to the Djinn and mayaccess, subject to security constraints, any one of the services itcontains. Thus, devices and users federate into a Djinn to share accessto its services. The services of the Djinn appear programmatically asobjects of the Java programming environment, which may include otherobjects, software components written in different programming languages,or hardware devices. A service has an interface defining the operationsthat can be requested of that service, and the type of the servicedetermines the interfaces that make up that service.

[0024]FIG. 1 depicts the exemplary distributed system 100 containing acomputer 102, a computer 104, and a device 106 interconnected by anetwork 108. The device 106 may be any of a number of devices, such as aprinter, fax machine, storage device, computer, or other devices. Thenetwork 108 may be a local area network, wide area network, or theInternet. Although only two computers and one device are depicted ascomprising the exemplary distributed system 100, one skilled in the artwill appreciate that the exemplary distributed system 100 may includeadditional computers or devices.

[0025]FIG. 2 depicts the computer 102 in greater detail to show a numberof the software components of the exemplary distributed system 100. Oneskilled in the art will appreciate that computer 104 or device 106 maybe similarly configured. Computer 102 includes a memory 202, a secondarystorage device 204, a central processing unit (CPU) 206, an input device208, and a video display 210. The memory 202 includes a lookup service212, a discovery server 214, and a Java™ runtime system 216. The Javaruntime system 216 includes the Java™ remote method invocation system(RMI) 218 and a Java™ virtual machine 220. The secondary storage device204 includes a JavaSpace™ 222.

[0026] As mentioned above, the exemplary distributed system 100 is basedon the Java programming environment and thus makes use of the Javaruntime system 216. The Java runtime system 216 includes the Java™ API,allowing programs running on top of the Java runtime system to access,in a platform-independent manner, various system functions, includingwindowing capabilities and networking capabilities of the host operatingsystem. Since the Java API provides a single common API across alloperating systems to which the Java runtime system 216 is ported, theprograms running on top of a Java runtime system run in aplatform-independent manner, regardless of the operating system orhardware configuration of the host platform. The Java runtime system 216is provided as part of the Java™ software development kit available fromSun Microsystems of Mountain View, Calif.

[0027] The Java virtual machine 220 also facilitates platformindependence. The Java virtual machine 220 acts like an abstractcomputing machine, receiving instructions from programs in the form ofbyte codes and interpreting these byte codes by dynamically convertingthem into a form for execution, such as object code, and executing them.RMI 218 facilitates remote method invocation by allowing objectsexecuting on one computer or device to invoke methods of an object onanother computer or device. Both RMI and the Java virtual machine arealso provided as part of the Java software development kit.

[0028] The lookup service 212 defines the services that are availablefor a particular Djinn. That is, there may be more than one Djinn and,consequently, more than one lookup service within the exemplarydistributed system 100. The lookup service 212 contains one object foreach service within the Djinn, and each object contains various methodsthat facilitate access to the corresponding service. The lookup service212 and its access are described in greater detail in co-pending U.S.patent application No. ______, entitled “Method and System forFacilitating Access to a Lookup Service,” which has previously beenincorporated by reference.

[0029] The discovery server 214 detects when a new device is added tothe exemplary distributed system 100, during a process known as boot andjoin or discovery, and when such a new device is detected, the discoveryserver passes a reference to the lookup service 212 to the new device,so that the new device may register its services with the lookup serviceand become a member of the Djinn. After registration, the new devicebecomes a member of the Djinn, and as a result, it may access all theservices contained in the lookup service 212. The process of boot andjoin is described in greater detail in co-pending U.S. patentapplication No. ______, entitled “Apparatus and Method for providingDownloadable Code for Use in Communicating with a Device in aDistributed System,” which has previously been incorporated byreference.

[0030] The JavaSpace 222 is an object repository used by programs withinthe exemplary distributed system 100 to store objects. Programs use theJavaSpace 222 to store objects persistently as well as to make themaccessible to other devices within the exemplary distributed system.JavaSpaces are described in greater detail in co-pending U.S. patentapplication Ser. No. 08/971,529, entitled “Database System EmployingPolymorphic Entry and Entry Matching,” assigned to a common assignee,filed on Nov. 17, 1997, which is incorporated herein by reference. Oneskilled in the art will appreciate that the exemplary distributed system100 may contain many lookup services, discovery servers, and JavaSpaces.

[0031] Although systems and methods consistent with the presentinvention are described as operating in the exemplary distributed systemand the Java programming environment, one skilled in the art willappreciate that the present invention can be practiced in other systemsand other programming environments. Additionally, although aspects ofthe present invention are described as being stored in memory, oneskilled in the art will appreciate that these aspects can also be storedon or read from other types of computer-readable media, such assecondary storage devices, like hard disks, floppy disks, or CD-ROM; acarrier wave from the Internet; or other forms of RAM or ROM. Sun, SunMicrosystems, the SunLogo, Java, and Java-based trademarks aretrademarks or registered trademarks of Sun Microsystems Inc. in theUnited States and other countries.

[0032]FIG. 3A is a flow chart illustrating methods consistent with thepresent invention for notifying and transporting behavior in anevent-based distributed system. Listener objects interested in theoccurrence of a certain event must register an interest in the event. Inparticular, for each interest to be registered, the registering objectsends a message to a notifier process, which is preferably an objectcontaining procedures for monitoring the occurrence of the event (step301). Generally, the notifier will be present in the virtual machine inwhich the event is expected to occur. The registration message includes:(1) implicit or explicit information identifying the event that is to bemonitored, (2) information identifying the object that is to be notifiedwhen the event occurs, and (3) an object, or a reference to an object,that is to be passed to the notified object when the event occurs. Thenotifier may use a table to store information relating to registrationmessages it has received, such as the table shown in FIG. 3B. Thenotifier monitors its system or the network for the occurrence of theevent (step 302). When the event occurs (step 303), the notifiernotifies the object identified by the registering object that theregistered event has occurred (step 304). Consistent with the presentinvention, the notification includes an identification of the event thatoccurred and the object or reference to the object that was passed tothe notified object when the event occurred (step 304).

[0033] An “event” as used throughout this specification can be broadlydefined as a change of system state. An event may be, for example, atimer event, a mouse click event, or a disk access event.

[0034]FIG. 4 is a block diagram illustrating a distributed computingsystem containing three exemplary computer systems 412, 413, and 414,connected to one another via a network. Computer systems 412-414 arephysically similar to computer systems 102 and 112. In particular, eachof computer systems 412, 413, and 414 includes a computer platform ormachine 409, 410, and 411, respectively, executing a virtual machine406, 407, or 408. Processes 402, 403, and 404 reside on their respectivevirtual machines 406, 407, and 408. Consistent with the presentinvention, computer systems 412, 413, and 414 form a distributedcomputing system using the event/notification model.

[0035] A hypothetical situation illustrating an application of thepresent invention will now be described with reference to thedistributed system shown in FIG. 4. Assume that “administrator ” process402, executing in virtual machine 406, has the responsibility ofmonitoring the network and reporting potential problems to a humanoperator—such as a disk drive running out of free space. Notifierprocess 403, executing on virtual machine 407, monitors the system forthe occurrence of disk drive full events. To register interest in a“DiskFull” event, process 402 transmits a registration message, called,for example, “RegisterInterest,” to notify process 403, such as themessage:

[0036] RegisterInterest (DisktFull, ReferenceToVM408,SendPage(“<parameters>”)).

[0037] In this message, “DiskFull” identifies the event that is to bemonitored, “ReferenceToVM408” is a reference to the entity that is to benotified in response to the occurrence of the event (in this case,virtual machine 408), and “SendPage” is an object that includes methodsand data that, when executed on a computer having a telephone connectionand the ability to dial a pager number, will instruct the computer topage a person at a specified number.

[0038] When the DiskFull event occurs, notifier process 403 notifies thedesignated entity, virtual machine 408, using a generic notify methodincluding the SendPage object, or a reference to the “SendPage” object,and an indication that the DiskFull event has occurred. In response,virtual machine 408 may create a process such as process 404 thatexecutes the methods designated in the SendPage object. The SendPageobject will then cause computer system 411 to page the appropriatetechnician.

[0039] As mentioned above, the notify method is preferably a genericmethod, meaning each virtual machine and/or computer platform mayinclude its own unique implementation of the notify method, althougheach implementation must meet the specifications required by thedefinition of the generic notify method.

[0040] Because the SendPage object includes, within itself, all requiredmethods and data for execution, SendPage is considered to be an objecthaving “closure.” By passing an object having closure to a designatedentity, the object initially registering the object does not have to beaware of the functions available at the final destination of the passedobject. This is particularly advantageous as it allows the objectinitially registering the event to easily modify the functionality ofthe passed object. For example, if the policy (functionality) of theSendPage object is created by an operator at computer 412, it isrelatively easy for the operator to modify the policy of SendPage by,for example, instructing SendPage to page a backup technician if thepage is not returned by the primary technician within twenty minutes.

[0041] Although SendPage was described as having closure by virtue ofhaving all its required methods and data encapsulated within the object,other objects may be passed that have closure even though code stillmust be supplied by the executing system. In particular, if the codethat must be supplied by the executing system implements well knownmethods that can be implemented in any one of a number of acceptableways, the object may have closure merely by referencing the genericmethod definitions and allow the executing system to provide the preciseimplementation.

[0042] While there has been illustrated and described what are atpresent considered to be preferred embodiments and methods of thepresent invention, it will be understood by those skilled in the artthat various changes and modifications may be made, and equivalents maybe substituted for elements thereof without departing from the truescope of the invention. For example, while the foregoing systems andmethods have been described with reference to a Java based run-timeenvironment, other run-time environments could conceivably be used toimplement the present invention.

[0043] In addition, many modifications may be made to adapt a particularelement, technique or implementation to the teachings of the presentinvention without departing from the central scope of the invention.Therefore, it is intended that this invention not be limited to theparticular embodiments and methods disclosed herein, but that theinvention include all embodiments falling within the scope of theappended claims.

What is claimed:
 1. A method for controlling program execution in a distributed computer system comprising the steps of: registering interest in an occurrence of an event in the distributed computer system, the registration of interest including information identifying the occurrence of the event, an identifier of a software entity in the distributed system, and a first object including a process and parameter data corresponding to the process; monitoring at least a portion of the distributed computer system for the occurrence of the registered event; notifying the software entity identified in the registration of interest when the event occurs, the notification including a copy of the first object and an identification of the event that occurred; and executing methods contained within the first object in response to the notifying step.
 2. The method of claim 1, wherein the notification step further includes the step of using a generic notify method to notify the software entity.
 3. The method of claim 1, wherein the step of registering interest further includes registering interest by a process located in a virtual machine different than the virtual machine in which the software entity is located.
 4. The method of claim 1, wherein the step of monitoring the distributed computer system is performed by a process in a virtual machine different than the virtual machine in which the software entity is located.
 5. A distributed computer system comprising: a memory containing a first virtual machine; a memory containing a second virtual machine executing a process that receives, from the first virtual machine, a registration of interest in an event and transmits a message in response to the occurrence of the event, the registration of interest and the message including computer code; and a memory containing a third virtual machine for receiving the message and executing the computer code; and processors for running the first virtual machine, the second virtual machine, and the third virtual machine.
 6. The distributed computer system of claim 5, wherein the message transmitted by the second virtual machine is a generic notify method.
 7. The distributed computer system of claim 5, wherein the registration of interest by the second virtual machine includes an identification of the event and an identification of the third virtual machine.
 8. The distributed computer system of claim 5, wherein each said virtual machine is on a separate computer.
 9. The distributed computer system of claim 5, wherein the computer code is implemented in an object.
 10. A protocol for controlling the execution of processes in a distributed computer system, the protocol comprising the steps of: receiving a registration of interest in an event that is expected to occur in the distributed computer system, the registration including an identifier of a software entity in the distributed system and a first object, the first object including computer instructions for performing a process and parameter data corresponding to the process; monitoring the distributed system for the occurrence of the registered event; notifying the software entity identified in the registration of interest when the event occurs, the notification including a copy of the first object and an identification of the event that occurred.
 11. The protocol of claim 10, wherein the notify step further includes the step of using a generic notify method to notify the software entity.
 12. A computer readable medium containing instructions for controlling program execution in a distributed computer system, the instructions causing the distributed computer system to perform the steps of: registering interest in an event in the distributed computer system, the registration of interest including information identifying the event, an identifier of a software entity in the distributed system, and computer code for executing a process; monitoring at least a portion of the distributed computer system for the occurrence of the registered event; notifying the software entity identified in the registration of interest when the event occurs, the notification including a copy of the computer code and an identification of the event that occurred; and executing methods contained within the first object in response to the notifying step.
 13. A computer readable medium containing instructions for implementing a protocol for controlling the execution of processes in a distributed computer system, the instructions causing a computer in the distributed computer system to perform the steps of: receiving a registration of interest in an event in the distributed computer system, the registration including an identifier of a software entity in the distributed system and a first object, the first object including computer instructions for performing a process and parameter data corresponding to the process; monitoring the distributed system for the occurrence of the registered event; and notifying the software entity identified in the registration of interest when the event occurs, the notification including a copy of the first object and an identification of the event that occurred. 